package com.xlr.excel.task;

import com.xlr.excel.queue.QueueHander;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * @Author: xlr
 * @Date: Created in 下午7:48 2019/3/3
 */
@Component
public class QueueListener {

    Executor executor = Executors.newFixedThreadPool(1);

    @Autowired
    QueueHander queueHander;

    @PostConstruct
    public void init(){
        executor.execute( new QueueTaskThread(queueHander) );
    }
}
